#include <bits/stdc++.h>

using namespace std;

class Solution {
    public:
        long long coutOfSubstringsAtLeast(const string & word, int k){
            string table = "aeiou";
            vector<int> isOk(5,0);
            auto check = [&](){
                for(auto & n:isOk) if(n <= 0) return false;
                return true;
            };
            int left = 0, n = word.size();
            long long ans = 0LL;
            for(int right = 0; right < n; ++right){
                int i = table.find(word[right]);
                if(i == table.npos) --k;
                else isOk[i]++;
                while(left <= right && check()){
                    ans++;
                    int j = table.find(word[left]);
                    if(j == table.npos) ++k;
                    else isOk[j]--;
                }
            }
            return ans;
        }
        long long countOfSubstrings(string word, int k) {
            return coutOfSubstringsAtLeast(word, k) - coutOfSubstringsAtLeast(word, k + 1);
        }
    };